<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<div class="row">
    <div class="panel-body" style="padding-bottom:0px">
        <div class="panel-body marpan">
            <div class="panel">
                <shiro:hasAnyRoles name="admin">
                    &nbsp&nbsp&nbsp&nbsp
                    <input type="button" class="btn btn-info" value="新增" onclick="javascript:$('#add').modal('show')"/>
                    &nbsp
                    <input type="button" class="btn btn-danger" value="删除" onclick="del()"/>
                </shiro:hasAnyRoles>
                <div id="toolbar" class="btn-group">
                    <h4><B style="color:orange">用户管理</B></h4>
                </div>
                <table id="tb_borrow" style="white-space: nowrap"></table>
            </div>
        </div>
    </div>
</div>
<div class="modal" id="add" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                添加用户
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span><span class="sr-only">关闭</span>
                </button>
            </div>
            <section class="content">
                <div class="row">
                    <div class="panel-body" style="padding-bottom:0px; margin-top: -40px">
                        <div class="panel-body marpan">
                            <form id="addForm" class="form-horizontal">
                                <div class="form-group3" style="margin-top: 15px">
                                    <label class="col-sm-12" for="username">用户名</label>
                                    <div class="col-sm-12">
                                        <input class="text" id="username" type="text" placeholder="请输入用户名"/>
                                    </div>
                                    <label class="col-sm-12" for="password">密码</label>
                                    <div class="col-sm-12">
                                        <input class="text" id="password" type="password" placeholder="请输入密码"/>
                                    </div>
                                    <label class="col-sm-12" for="catetgorySelect">所属类型</label>
                                    <div class="col-sm-12">
                                        <select id="catetgorySelectAdd"></select>
                                    </div>
                                    <label class="col-sm-12" for="role">角色</label>
                                    <div class="col-sm-12">
                                        <select id="role">
                                            <option value="admin">admin</option>
                                            <option value="cs">厂商</option>
                                            <option value="sh">商户</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-4" style="text-align: left; margin-top: 10px">
                                        <button type="button" class="btn btn-primary add" onclick="add()" value="保存">保存</button>
                                        <button type="button" class="btn btn-primary" data-dismiss="modal" value="关闭">关闭</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- /.row -->
            </section>
        </div>
    </div>
</div>
<div class="modal" id="modi" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                修改用户
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span><span class="sr-only">关闭</span>
                </button>
            </div>
            <section class="content">
                <div class="row">
                    <div class="panel-body" style="padding-bottom:0px; margin-top: -40px">
                        <div class="panel-body marpan">
                            <form id="modiForm" class="form-horizontal">
                                <input id="uid" type="hidden"/>
                                <div class="form-group3" style="margin-top: 15px">
                                    <label class="col-sm-12" for="password1">密码</label>
                                    <div class="col-sm-12">
                                        <input class="text" id="password1" type="password" placeholder="请输入密码"/>
                                    </div>
                                    <label class="col-sm-12" for="catetgorySelect">所属类型</label>
                                    <div class="col-sm-12">
                                        <select id="catetgorySelect"></select>
                                    </div>
                                    <label class="col-sm-12" for="role1">角色</label>
                                    <div class="col-sm-12">
                                        <select id="role1">
                                            <option value="admin">admin</option>
                                            <option value="cs">厂商</option>
                                            <option value="sh">商户</option>
                                        </select>
                                    </div>
                                    <div class="col-sm-4" style="text-align: left; margin-top: 10px">
                                        <button type="button" class="btn btn-primary add" onclick="update()" value="修改">修改</button>
                                        <button type="button" class="btn btn-primary" data-dismiss="modal" value="关闭">关闭</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- /.row -->
            </section>
        </div>
    </div>
</div>
<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">详情</h4>
            </div>
            <div class="modal-body">
                <ul class="list-group" id="receipt_detail" style="word-break:break-all;">
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/user.js"></script>
</html>
